package common.item
{
	import com.common.utils.Reflection;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	import lz.controls.ImageContain;

	/**
	 *基础球员显示框 item
	 * 各模块球员显示继承 
	 * @author lake
	 * 
	 */	
	public class BasePlayerItem extends Sprite
	{
		/**
		 *皮肤 
		 */
		protected var _symbolSkin:MovieClip;
		/**
		 *头像容器 
		 */
		protected var _picture:MovieClip;
		/**
		 *头像 
		 */
		protected var _image:ImageContain;
		/**
		 *选中框  
		 */
		protected var _frame:MovieClip;
		/**
		 *号码 
		 */
		protected var _number:TextField;
		/**
		 *位置 
		 */
		protected var _place:TextField;
		/**
		 *球员颜色背景 
		 */		
		protected var _changeBg:MovieClip;
		/**
		 *勾 
		 */
		protected var trainIcon:MovieClip;
		/**
		 * 锁 
		 */
		protected var lockIcon:MovieClip;
		/**
		 * 锁（绑定） 
		 */
		public var _lock:MovieClip;
		/**
		 * 自己的图标标志 
		 */
		public var _selfIcon:MovieClip;
		public function BasePlayerItem()
		{
			super();
			_symbolSkin = Reflection.createInstance("com.liangzhong.ui.PlayerItem");
			_picture = _symbolSkin._picture;
			_frame = _symbolSkin._frame;
			_changeBg = _symbolSkin.changeBg;
			trainIcon = _symbolSkin.trainIcon;
			trainIcon.visible = false;
			lockIcon = _symbolSkin.lockIcon;
			lockIcon.visible = false;
			_lock = _symbolSkin._lock;
			_lock.visible = false;
			_selfIcon = _symbolSkin._selfIcon;
			_selfIcon.visible = false;
			_number = _symbolSkin._number;
			_place = _symbolSkin._place;
		}
		/**
		 * 绑定锁 
		 * 
		 */
		public function bindingLock($isShow:Boolean = false):void
		{
			_lock.visible = $isShow;
		}
		/**
		 * 显示自己的图标
		 * 默认值为0则不显示
		 */
		public function showSelfIcon($value:int = 0):void
		{
			if($value == 0)
			{
				_selfIcon.visible = false;
			}else
			{
				_selfIcon.visible = true;
				_selfIcon.gotoAndStop($value);
			}
		}
	}
}